<%@page import="vo.Product"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="org.hibernate.Query"%>
<%@page import=" org.hibernate.Session"%>
<%@page import="org.hibernate.SessionFactory"%>
<%@page import="org.hibernate.Transaction "%>
<%@page import="org.hibernate.cfg.Configuration "%>
<%@page import=" org.hibernate.criterion.Restrictions"%>
<%@page import="vo.Product"%>
<%@page import="com.opensymphony.xwork2.ActionContext"%>
<%@page import="com.opensymphony.xwork2.ActionSupport"%>
<%@page import="org.HibernateSessionFactory" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'IDcheckproduct.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <%@page contentType="text/html"%>
  <center>
  <font size=6 color=blue>查询内容如下</font><hr>
   
   <%  SessionFactory sf = new Configuration().configure()
				.buildSessionFactory();
		Session ses = sf.openSession();
		String aaa=request.getParameter("productid");
		String hql="from Product product where product.productid like '%"+aaa+"%'";
		Query query=ses.createQuery(hql); 
		List list=query.list();
		Iterator it=list.iterator();
		while(it.hasNext()){
			Product product=(Product)it.next();
		out.println("商品名称："+product.getProductname()+" 商品类别："+product.getCatelog().getCatelogname()+"商品价格："+product.getPrice());}%><br><br>
		<a href="checkuser.jsp">返回上一页</a><br><br>
		<a href="index.jsp">返回主界面</a>
  </center></body>
  </body>
</html>
